home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Source Code
/
Pascal
/
Applications
/
TCPExample
/
PNL Libraries
/
MyCallProc.p
< prev
next >
Wrap
Text File
|
1997-04-09
|
9KB
|
302 lines
unit MyCallProc;
interface
uses
Types, MixedMode;
const
uppPascal0ProcInfo = kPascalStackBased + $10*kNoByteCode;
uppPascal02ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kTwoByteCode;
uppPascal04ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kFourByteCode;
uppPascal022ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kTwoByteCode + $100* kTwoByteCode;
uppPascal042ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kFourByteCode + $100* kTwoByteCode;
uppPascal044ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kFourByteCode + $100* kFourByteCode;
uppPascal0444ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kFourByteCode + $100* kFourByteCode + $400* kFourByteCode;
{ uppPascal02244ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kTwoByteCode + $100* kTwoByteCode + $400* kFourByteCode + $1000* kFourByteCode;}
uppPascal04244ProcInfo = kPascalStackBased + $10*kNoByteCode + $40* kFourByteCode + $100* kTwoByteCode + $400* kFourByteCode + $1000* kFourByteCode;
uppPascal14ProcInfo = kPascalStackBased + $10*kOneByteCode + $40* kFourByteCode;
uppPascal2ProcInfo = kPascalStackBased + $10*kTwoByteCode;
uppPascal22ProcInfo = kPascalStackBased + $10*kTwoByteCode + $40* kTwoByteCode;
uppPascal24ProcInfo = kPascalStackBased + $10*kTwoByteCode + $40* kFourByteCode;
uppPascal4ProcInfo = kPascalStackBased + $10*kFourByteCode;
uppPascal44ProcInfo = kPascalStackBased + $10*kFourByteCode + $40* kFourByteCode;
uppC04ProcInfo = kCStackBased + $10*kNoByteCode + $40* kFourByteCode;
uppC24ProcInfo = kCStackBased + $10*kTwoByteCode + $40* kFourByteCode;
uppC244ProcInfo = kCStackBased + $10*kTwoByteCode + $40* kFourByteCode + $100* kFourByteCode;
uppC2444ProcInfo = kCStackBased + $10*kTwoByteCode + $40* kFourByteCode + $100* kFourByteCode + $400* kFourByteCode;
uppC244444ProcInfo = kCStackBased + $10*kTwoByteCode + $40* kFourByteCode + $100* kFourByteCode + $400* kFourByteCode + $1000* kFourByteCode + $4000* kFourByteCode;
function NewProc(userRoutine: ProcPtr; upp:longint): UniversalProcPtr;
{$IFC not GENERATINGPOWERPC }
inline
$584F,$2E9F;
{$ENDC}
function New68kProc(userRoutine: ProcPtr; upp:longint): UniversalProcPtr;
{$IFC not GENERATINGPOWERPC }
inline
$584F,$2E9F;
{$ENDC}
procedure CallPascal0 (proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
procedure CallPascal04 (p1:univ SInt32; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
procedure CallPascal02 (p1:univ SInt16; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
procedure CallPascal022 (p1:univ SInt16; p2: univ SInt16; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
procedure CallPascal042 (p1:univ SInt32; p2: univ SInt16; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
procedure CallPascal044 (p1:univ SInt32; p2: univ SInt32; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
procedure CallPascal0444 (p1:univ SInt32; p2:univ SInt32; p3:univ SInt32; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
(*
procedure CallPascal02244 (p1:univ SInt16; p2: univ SInt16; p3:univ SInt32; p4:univ SInt32; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
*)
procedure CallPascal04244 (p1:univ SInt32; p2: univ SInt16; p3:univ SInt32; p4:univ SInt32; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
function CallPascal14 (p1:univ SInt32; proc: UniversalProcPtr): SInt8;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
function CallPascalB4 (p1:univ SInt32; proc: UniversalProcPtr): Boolean;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
function CallPascal2(proc: UniversalProcPtr):SInt16;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
function CallPascal22(p1:univ SInt16; proc: UniversalProcPtr):SInt16;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
function CallPascal24(p1:univ SInt32; proc: UniversalProcPtr):SInt16;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
function CallPascal44(p1:univ SInt32; proc: UniversalProcPtr):SInt32;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90;
{$ENDC}
procedure CallC04(p1:univ SInt32; proc: UniversalProcPtr);
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90,$584F;
{$ENDC}
function CallC24(p1:univ SInt32; proc: UniversalProcPtr):SInt16;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90,$584F,$3E80;
{$ENDC}
function CallC244(p2,p1:univ SInt32; proc: UniversalProcPtr):SInt16;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90,$504F,$3E80;
{$ENDC}
function CallC2444(p3,p2,p1:univ SInt32; proc: UniversalProcPtr):SInt16;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90,$DEFC,$000C,$3E80;
{$ENDC}
function CallC244444(p5,p4,p3,p2,p1:univ SInt32; proc: UniversalProcPtr):SInt16;
{$IFC not GENERATINGPOWERPC}
inline
$205F, $4E90,$DEFC,$0014,$3E80;
{$ENDC}
implementation
{$IFC GENERATINGPOWERPC}
function NewProc(userRoutine: ProcPtr; upp:longint): UniversalProcPtr;
begin
NewProc:=NewRoutineDescriptor(userRoutine,upp,GetCurrentISA);
end;
function New68kProc(userRoutine: ProcPtr; upp:longint): UniversalProcPtr;
begin
New68kProc:=NewRoutineDescriptor(userRoutine,upp,kM68kISA);
end;
procedure CallPascal0 (proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal0ProcInfo);
end;
procedure CallPascal04 (p1:univ SInt32; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal04ProcInfo, p1);
end;
procedure CallPascal02 (p1:univ SInt16; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal02ProcInfo, p1);
end;
procedure CallPascal022 (p1:univ SInt16; p2: univ SInt16; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal022ProcInfo, p1,p2);
end;
procedure CallPascal042 (p1:univ SInt32; p2: univ SInt16; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal042ProcInfo, p1,p2);
end;
procedure CallPascal044 (p1:univ SInt32; p2: univ SInt32; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal044ProcInfo, p1,p2);
end;
procedure CallPascal0444 (p1:univ SInt32; p2:univ SInt32; p3:univ SInt32; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal0444ProcInfo, p1,p2,p3);
end;
{
procedure CallPascal02244 (p1:univ SInt16; p2: univ SInt16; p3:univ SInt32; p4:univ SInt32; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal02244ProcInfo, p1,p2,p3,p4);
end;
}
procedure CallPascal04244 (p1:univ SInt32; p2: univ SInt16; p3:univ SInt32; p4:univ SInt32; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppPascal04244ProcInfo, p1,p2,p3,p4);
end;
function CallPascal14 (p1:univ SInt32; proc: UniversalProcPtr): SInt8;
begin
CallPascal14:= CallUniversalProc(proc, uppPascal14ProcInfo, p1);
end;
function CallPascalB4 (p1:univ SInt32; proc: UniversalProcPtr): Boolean;
begin
CallPascalB4:= CallUniversalProc(proc, uppPascal14ProcInfo, p1) <> 0;
end;
function CallPascal2(proc: UniversalProcPtr):SInt16;
begin
CallPascal2:= CallUniversalProc(proc, uppPascal2ProcInfo);
end;
function CallPascal22(p1:univ SInt16; proc: UniversalProcPtr):SInt16;
begin
CallPascal22:= CallUniversalProc(proc, uppPascal22ProcInfo, p1);
end;
function CallPascal24(p1:univ SInt32; proc: UniversalProcPtr):SInt16;
begin
CallPascal24:= CallUniversalProc(proc, uppPascal24ProcInfo, p1);
end;
function CallPascal44(p1:univ SInt32; proc: UniversalProcPtr):SInt32;
begin
CallPascal44:= CallUniversalProc(proc, uppPascal44ProcInfo, p1);
end;
procedure CallC04(p1:univ SInt32; proc: UniversalProcPtr);
var
junk_long:longint;
begin
junk_long:= CallUniversalProc(proc, uppC04ProcInfo, p1);
end;
function CallC24(p1:univ SInt32; proc: UniversalProcPtr):SInt16;
begin
CallC24:= CallUniversalProc(proc, uppC24ProcInfo, p1);
end;
function CallC244(p2,p1:univ SInt32; proc: UniversalProcPtr):SInt16;
begin
CallC244:= CallUniversalProc(proc, uppC244ProcInfo, p1, p2);
end;
function CallC2444(p3,p2,p1:univ SInt32; proc: UniversalProcPtr):SInt16;
begin
CallC2444:= CallUniversalProc(proc, uppC2444ProcInfo, p1, p2, p3);
end;
function CallC244444(p5,p4,p3,p2,p1:univ SInt32; proc: UniversalProcPtr):SInt16;
begin
CallC244444:= CallUniversalProc(proc, uppC244444ProcInfo, p1, p2, p3, p4, p5);
end;
{$ENDC}
end.
{ Edit history }
{13 July 96 jc Added the 042 pattern }